Skip to content

added example from the issue and fixed empty over#1483

Merged
fnc12 merged 3 commits into
devfrom
bugfix/475
May 8, 2026
Merged

added example from the issue and fixed empty over#1483
fnc12 merged 3 commits into
devfrom
bugfix/475

Conversation

@fnc12
Copy link
Copy Markdown
Owner

@fnc12 fnc12 commented May 7, 2026

No description provided.

@fnc12 fnc12 requested a review from trueqbit May 7, 2026 15:53
@trueqbit trueqbit linked an issue May 7, 2026 that may be closed by this pull request
Comment thread dev/statement_serializer.h Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This serializer specialization is unused.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

Comment thread dev/statement_serializer.h Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can reuse streaming_actions_tuple:

ss << " OVER (" << streaming_actions_tuple(arguments, context) << ")";

It makes sense to rename streaming_actions_tuple to streaming_definition_tuple.

In general it would be nice to keep the [first = true], sep[std::exchange(first, false)] logic that we have everywhere else.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment thread dev/statement_serializer.h Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can reuse streaming_actions_tuple:

ss << "WINDOW " << statement.name << " AS (" << streaming_actions_tuple(statement.arguments, context) << ")";

It makes sense to rename streaming_actions_tuple to streaming_definition_tuple.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment thread dev/statement_serializer.h Outdated
@@ -548,9 +548,10 @@ namespace sqlite_orm::internal {
template<class Tuple, class Ctx>
void serialize_over_arguments(std::stringstream& ss, const Tuple& arguments, const Ctx& context) {
using args_tuple = std::decay_t<Tuple>;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decay is unnecessary here.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

Comment thread dev/statement_serializer.h Outdated
void serialize_over_arguments(std::stringstream& ss, const Tuple& arguments, const Ctx& context) {
using args_tuple = std::decay_t<Tuple>;
if constexpr (std::tuple_size_v<args_tuple> == 0) {
if constexpr (std::tuple_size_v<Tuple> == 0) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry, I forgot to include this in the last review: we still need to use std::tuple_size<>::value. We require C++17 core language features but we still can't rely on a fully implemented C++17 Standard Library.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment thread dev/statement_serializer.h Outdated
ss << " OVER ()";
} else if constexpr (std::tuple_size_v<args_tuple> == 1 &&
std::is_same_v<std::tuple_element_t<0, args_tuple>, window_ref_t>) {
} else if constexpr (std::tuple_size_v<Tuple> == 1 &&
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use std::tuple_size<>::value

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@fnc12 fnc12 requested a review from trueqbit May 8, 2026 14:59
@fnc12 fnc12 merged commit be161fe into dev May 8, 2026
12 checks passed
@trueqbit trueqbit deleted the bugfix/475 branch May 10, 2026 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request for OVER clause [Window function ?]

2 participants